package com.ruoyi.system.service.city.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.city.CityProjectMapper;
import com.ruoyi.system.domain.city.CityProject;
import com.ruoyi.system.service.city.ICityProjectService;

/**
 * 项目Service业务层处理
 *
 * @author cjq
 * @date 2023-07-24
 */
@Service
public class CityProjectServiceImpl extends ServiceImpl<CityProjectMapper, CityProject> implements ICityProjectService {
    @Autowired
    private CityProjectMapper cityProjectMapper;



    /**
     * 查询项目
     *
     * @param projectId 项目主键
     * @return 项目
     */
    @Override
    public CityProject selectCityProjectByProjectId(Long projectId) {
        return cityProjectMapper.selectCityProjectByProjectId(projectId);
    }

    /**
     * 查询项目列表
     *
     * @param userId 用户唯一识别
     * @return 项目集合
     */
    @Override
    public List<CityProject> selectCollectCityProjectList(Long userId) {
        return cityProjectMapper.selectCollectCityProjectList(userId);
    }

    /**
     * 查询项目列表
     *
     * @param userId 用户唯一识别
     * @return 项目集合
     */
    @Override
    public List<CityProject> selectShareCityProjectList(Long userId) {
        return cityProjectMapper.selectShareCityProjectList(userId);
    }

    /**
     * 查询项目列表
     *
     * @param cityProject 项目
     * @return 项目
     */
    @Override
    public List<CityProject> selectCityProjectList(CityProject cityProject) {
        return cityProjectMapper.selectCityProjectList(cityProject);
    }

    /**
     * 新增项目
     *
     * @param cityProject 项目
     * @return 结果
     */
    @Override
    public int insertCityProject(CityProject cityProject) {
        cityProject.setCreateTime(DateUtils.getNowDate());
        return cityProjectMapper.insertCityProject(cityProject);
    }

    /**
     * 修改项目
     *
     * @param cityProject 项目
     * @return 结果
     */
    @Override
    public int updateCityProject(CityProject cityProject) {
        return cityProjectMapper.updateCityProject(cityProject);
    }

    /**
     * 批量删除项目
     *
     * @param projectIds 需要删除的项目主键
     * @return 结果
     */
    @Override
    public int deleteCityProjectByProjectIds(Long[] projectIds) {
        return cityProjectMapper.deleteCityProjectByProjectIds(projectIds);
    }

    /**
     * 删除项目信息
     *
     * @param projectId 项目主键
     * @return 结果
     */
    @Override
    public int deleteCityProjectByProjectId(Long projectId) {
        return cityProjectMapper.deleteCityProjectByProjectId(projectId);
    }
}
